def isF(num):
    pivot = num % 10
    while num:
        if num % 10 != pivot:
            return False
        num //= 10
    return True


# for i in []:
for i in range(1, 500):
    if not i % 10 or (i % 2 == 0 and i >= 10):
        print(i, -1)
        continue
    j = i
    while not isF(j):
        j += i
    print(i, j)
